package com.tron.dobest.common;

/**
 * 自定义异常
 */
public class TronException extends RuntimeException {
    private Integer code;
    private String message;
    //方法参数可以是枚举
    public TronException(Integer code, String message) {
        this.message = message;
        this.code = code;
    }

    public TronException(ExceptionEnum exceptionEnum){
        this.code = exceptionEnum.getCode();
        this.message = exceptionEnum.getMessage();
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage(){
        return message;
    }
}
